import { post, get, postForm, postFile, put, delet, postHeaderJson } from './request'

const BaseUrlApi = import.meta.env.VITE_APP_BASE_API
/*
* 【用户管理模块】
*/ 
// 注册
export const signUp = (data) => post(BaseUrlApi + "/api/policy/register", data);
//登录
export const signIn = (data) => post(BaseUrlApi + "/api/policy/login", data);
// 修改昵称，密码
export const modifyUserInfo = (data) => post(BaseUrlApi + "/api/user/modify", data);
// 查询头像
export const findUserAvatars = (data) => get(BaseUrlApi + "/api/policy/avatar", data);
// 发送验证码
export const sendVerifyCode = (data) => post(BaseUrlApi + "/api/policy/otp", data);
// 修改密码
export const resetPsw = (data) => post(BaseUrlApi + "/api/policy/reset", data);

// 退出登录
export const loginOut = (data) => post(BaseUrlApi + "/api/user/quit", data);

//查看是否是vip
export const getProfileVip = (data) => get(BaseUrlApi + '/api/user/profile', data)



/*
* 【产品管理模块】
*/ 
// 首页接口
export const queryProduct = (data) => get(BaseUrlApi + "/api/platform/multiple", data);
// 打开平台播放
export const queryFire = (data) => post(BaseUrlApi + "/api/user/fire", data);
// 校验IP账号登录
export const detection = (data) => post(BaseUrlApi + "/api/user/detection", data);
// cookie 存储
export const saveCookies = (data) => post(BaseUrlApi + "/api/user/detection-notify", data);
// 获取邮箱验证码
export const queryCode = (data) => get(BaseUrlApi + "/api/account/code", data);
// cookie 校验
export const examine = (data) => post(BaseUrlApi + "/api/user/examine", data);
// cookie 提交
export const examineNotify = (data) => post(BaseUrlApi + "/api/user/examine-notify", data);
// 是否开启IP校验
export const checkIP = (data) => get(BaseUrlApi + "/api/policy/system", data);

// 海外版打开平台播放
export const startFire = (data) => post(BaseUrlApi + "/api/user/abroad/fire", data);
// 海外版平台管理
export const queryMultiple = (data) => get(BaseUrlApi + '/api/platform/abroad/multiple', data)




/*
* 【价格模块】
*/ 
// 价格接口
export const queryPricePackage = (data) => get(BaseUrlApi + "/api/platform/package", data);
// 创建订单
export const createUserOrderInfo = (data) => post(BaseUrlApi + "/api/payment/create", data);
// 获取支付列表
export const queryPayments = (data) => get(BaseUrlApi + "/api/payment/code", data);

// 支付回调
export const payConfirm = (data) => post(BaseUrlApi + "/api/order/confirm", data);

// 支付成功提交方案
export const payVerify = (data) => post(BaseUrlApi + "/api/payment/verify", data);





/*
* 【我的订单模块】
*/ 
// 查询支付列表
export const queryOrderList = (data) => get(BaseUrlApi + "/api/order/list", data);

// 去支付
export const goPayment = (data) => post(BaseUrlApi + "/api/payment/go", data);

// 兑换码兑换
export const exchange = (data) => post(BaseUrlApi + "/api/order/exchange", data);

// 获取兑换码列表
export const exchangeList = (data) => get(BaseUrlApi + "/api/order/exchange/list", data);

// 获取数据设备绑定
export const queryDevices = (data) => get(BaseUrlApi + "/api/user/mac", data);

// 删除设备绑定
export const delDevices = (data) => post(BaseUrlApi + "/api/user/mac/delete", data);



/*
* 【帮助中心模块】
*/ 
// 查询页面列表，分类
export const queryHelpList = (data) => get(BaseUrlApi + "/api/help/index", data);
// 查询页面列表
export const queryHelpInfo = (data) => get(BaseUrlApi + "/api/help/list", data);


/*
 * 【意见反馈模块】
 */
// 上传接口
export const uploadFile = (data) => postFile(BaseUrlApi + "/api/file/upload", data);

// 提交意见反馈
export const submitFeedback = (data) => post(BaseUrlApi + "/api/workorder/create", data);
